package net.butfly.albacore.utils;

import java.io.InputStream;

import net.butfly.albacore.exception.EncryptException;

public final class EncryptUtils {

	private EncryptUtils() {}

	public static String encrypt(String uncrypted, Encryptor encryptor) {
		return ByteUtils.byte2hex(encryptor.encrypt(ByteUtils.str2byte(uncrypted)));
	}

	public static String decrypt(String encrypted, Encryptor encryptor) {
		return ByteUtils.byte2str(encryptor.decrypt(ByteUtils.hex2byte(encrypted)));
	}

	public static InputStream encrypt(InputStream is, Encryptor encryptor) {
		throw new EncryptException("Not implemented!");
	}

	public static InputStream decrypt(InputStream is, Encryptor encryptor) {
		throw new EncryptException("Not implemented!");
	}
}
